package net.koodar.forge.system.support.operateLog.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import net.koodar.forge.mybatis.doman.BaseEntity;

/**
 * 操作日志
 *
 * @author liyc
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_operate_log")
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class OperateLog extends BaseEntity<OperateLog> {

	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	/**
	 * 操作人id
	 */
	@TableField("operate_user_id")
	private Long operateUserId;

	/**
	 * 操作人名称
	 */
	@TableField("operate_user_name")
	private String operateUserName;
	/**
	 * 操作模块
	 */
	@TableField("module")
	private String module;

	/**
	 * 操作内容
	 */
	@TableField("content")
	private String content;

	/**
	 * 请求路径
	 */
	@TableField("url")
	private String url;

	/**
	 * 请求方法
	 */
	@TableField("method")
	private String method;

	/**
	 * 请求参数
	 */
	@TableField("param")
	private String param;

	/**
	 * 客户ip
	 */
	@TableField("ip")
	private String ip;

	/**
	 * user-agent
	 */
	@TableField("user_agent")
	private String userAgent;

	/**
	 * 请求结果 0失败 1成功
	 */
	@TableField("success_flag")
	private Boolean successFlag;

	/**
	 * 失败原因
	 */
	@TableField("fail_reason")
	private String failReason;
}
